package com.xsf.pay.common.constraints;


import com.xsf.pay.common.constraints.validator.UrlValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

import java.lang.annotation.Documented;
import java.lang.annotation.Retention;
import java.lang.annotation.Target;

import static java.lang.annotation.ElementType.*;
import static java.lang.annotation.RetentionPolicy.RUNTIME;

/**
 * @Author xujianfeng
 * @DATE 2023/7/7 10:46
 */
@Documented
@Constraint(validatedBy = {UrlValidator.class})
@Target({METHOD, FIELD, ANNOTATION_TYPE, CONSTRUCTOR, PARAMETER, TYPE_USE})
@Retention(RUNTIME)
public @interface URL {
    boolean required() default false;

    String message() default "url格式错误";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
